/**
 * 内置正则表达式
 */
export const patternType = {
  phone: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
  email: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
  idCard:
    /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  url: /^(http|https|ftp):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$/,
  digit: /^[1-9]\d*$/,
  letter: /^[a-zA-Z]+$/,
  decimal: /^[1-9]\d*(\.\d{1,2})?$/,
  chinese:
    /^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,
};

export const validPatternType = {
  chinese: /[u4e00-u9fa5]/g,
  digit: /[^/d]/g,
  letter: /[^a-zA-Z]/g,
  letterAndDigit: /[^a-zA-Z/d]/g,
  decimal: /[^/d.]/g,
}